package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.ciku.CikuKeywordsQuery;
import com.uzai.console.entity.CikuKeywords;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface CikuKeywordsMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int insert(CikuKeywords record);

    int insertSelective(CikuKeywords record);

    CikuKeywords selectById(@Param("id") Long id, @Param("merId") Long merId);

    int updateByIdSelective(CikuKeywords record);

    int updateById(CikuKeywords record);

    CikuKeywords getByKeywordAndDeviceUniqueId(@Param("keyword")String keyword, @Param("merId")Long merId, @Param("deviceUniqueId") Long deviceUniqueId);

    void delByReplyId(@Param("replyId")Long replyId, @Param("merId") Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<CikuKeywords> findByList(Page<CikuKeywords> page, @Param("query") CikuKeywordsQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<CikuKeywords> findByList(@Param("query") CikuKeywordsQuery query);

}